//
//  RMMMemberCardListTableViewCell.m
//  Romomo
//
//  Created by puman on 2017/2/20.
//  Copyright © 2017年 mazegong. All rights reserved.
//

#import "RMMMemberCardListTableViewCell.h"

@implementation RMMMemberCardListTableViewCell
{
    UILabel *_titleLabel;
    UILabel *_timeLabel;
    UILabel *_statusLabel;
    UILabel *_priceLabel;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, kScreenWideth - 15 - 135, 20)];
        _titleLabel.textColor = COLORFROMCODE(0x2C2C2C, 1);
        _titleLabel.font = kFont(14);
        [self.contentView addSubview:_titleLabel];
        
        _statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.right, _titleLabel.top, 100, 20)];
        _statusLabel.textColor = COLORFROMCODE(0xBFBFBF, 1);
        _statusLabel.font = kFont(12);
        [self.contentView addSubview:_statusLabel];

        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, _titleLabel.bottom, kScreenWideth - 30, 20)];
        _timeLabel.textColor = COLORFROMCODE(0x2C2C2C, 1);
        _timeLabel.font = kFont(12);
        [self.contentView addSubview:_timeLabel];

        _priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWideth - 135, 0, 120, 60)];
        _priceLabel.textColor = COLORFROMCODE(0x2C2C2C, 1);
        _priceLabel.font = kFont(12);
        _priceLabel.textAlignment = NSTextAlignmentRight;
        _priceLabel.numberOfLines = 0;
        _priceLabel.font = kFont(16);
        [self.contentView addSubview:_priceLabel];
    }
    return self;
}
- (void)setDic:(NSDictionary *)dic{
    _titleLabel.text = [RMMFileManager retrunObjWith:dic[@"PROD_NAME"]];
    _timeLabel.text = [RMMFileManager retrunObjWith:dic[@"TRANS_DATE"]];
    if ([dic[@"ORDER_TYPE"] isEqualToString:@"1"] || [dic[@"ORDER_TYPE"] isEqualToString:@"4"] || [dic[@"ORDER_TYPE"] isEqualToString:@"10"]) {
        _priceLabel.text = [RMMFileManager retrunObjWith:[NSString stringWithFormat:@"- %@",dic[@"PAY_AMT"]]];
        _priceLabel.textColor = COLORFROMCODE(0x2C2C2C, 1);
    } else {
        _priceLabel.text = [RMMFileManager retrunObjWith:[NSString stringWithFormat:@"+ %@",dic[@"PAY_AMT"]]];
        _priceLabel.textColor = kBasicColor;
    }
    // oreder_type 0消费,1充值

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
